home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / doc / notes4.99d < prev    next >
Encoding:
Text File  |  1993-10-25  |  11.9 KB  |  259 lines

  1. Pre-announcement
  2. ----------------
  3.  
  4. As I mentioned in the previous plplot beta update, I have been working on a
  5. plplot TCL/TK driver under Unix/X (if you're not running Unix/X you might as
  6. well skip this message).  Well, I am now far enough along that I can
  7. confidently say it will see the light of day before too long, on the order of
  8. weeks I hope.  It should be really nice, too, and am letting everybody know
  9. ahead of time so that you can go get the TCL/TK distribution (if you don't
  10. have it already) and start playing with it.  TCL is an embeddable interpreter
  11. in the spirit of Perl, and TK a Motif-like toolkit.  They are free and very
  12. high quality; furthermore, constructing the script language & interpreter
  13. together with a toolkit appears to be an outrageously useful thing to do.
  14. You have to try it to see why.  For more info, consult the substantial
  15. documentation (and demos) for TCL/TK.  I have appended the FAQ to the end of
  16. this message.  To quickly find the section on how to get TCL/TK and assorted
  17. other stuff, search on the string "Tcl/Tk Package Catalog".
  18.  
  19. Moving on, the basic code is done and I am finally getting simple plots out.
  20. What I have is the following:
  21.  
  22. User-code
  23.        |
  24.    plplot tk driver                         plserver
  25.    TCL interpreter <------ tk send ------> interpreter
  26.            |                                    |
  27.        data writer  ---- named pipe -----> data reader
  28.                                                  |
  29.                                            child X window
  30.  
  31. The user-code and the renderer (tentatively called plserver, I may change
  32. this) form a client/server relationship, and are separate processes.  Under
  33. typical usage, where the user-code starts first, it forks (vfork on systems
  34. that support it) and execs the renderer.  TCL/TK communication (via X
  35. properties) is used between their embedded interpreters to send commands back
  36. and forth (note: an extended version of TCL called TCL-DP allows sockets
  37. to be used for this, and I will eventually try to extend the model to 
  38. allow distribution across a network).  The existence of an interpreter in
  39. each process (actually each plplot stream that uses tk too) allows for
  40. a very easy & robust method of sending commands between processes.  
  41. The data goes through via an alternate channel (fifo for now, maybe socket
  42. later) for maximum speed.
  43.  
  44. Also I will support an alternate configuration where the server launches
  45. applications, telling them what plplot widget to plot to.  Lots of nice
  46. possibilities there.
  47.  
  48. By offloading the GUI-building code into a simple script language, it becomes
  49. easy to build menus, buttons, scrollbars, etc.  All of these will be
  50. configurable by the user, as well as the ability to map events (such as
  51. button presses) to functions calls in your own program.  But you will need to
  52. learn TCL/TK to get maximum benefit.  Even without additional effort,
  53. however, you will be able to use the new driver's menus to do zooming, dump
  54. to file, etc.
  55.  
  56. More later..
  57.  
  58. --
  59. Maurice LeBrun    mjl@dino.ph.utexas.edu
  60. Institute for Fusion Studies, University of Texas at Austin
  61.  
  62. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  63. attendre, c'est pour mieux vous servir, et vous plaire.
  64.                                 [menu of restaurant Antoine, New Orleans]
  65.  
  66. From mjl@dino.ph.utexas.edu Thu Aug 19 11:24 CDT 1993
  67. Received: by dino.ph.utexas.edu
  68.     (1.37.109.4/16.2) id AA13028; Thu, 19 Aug 93 11:24:46 -0500
  69. From: Maurice J. LeBrun <mjl@dino.ph.utexas.edu>
  70. Return-Path: <mjl@dino.ph.utexas.edu>
  71. Subject: slowness of the TK driver over the net
  72. To: wdn@ctrss2.lanl.gov
  73. Date: Thu, 19 Aug 93 11:24:46 CDT
  74. Cc: furnish@dino.ph.utexas.edu, gray@dino.ph.utexas.edu,
  75.         mjl@dino.ph.utexas.edu
  76. In-Reply-To: <9308191528.AA03769@ctrss2.lanl.gov.lanl.gov>; from "William D. Nystrom" at Aug 19, 93 9:28 am
  77. Mailer: Elm [revision: 70.85]
  78. Status: RO
  79.  
  80. >      Also, I used plrender to render a meta file on dino and display on
  81. > ctrss2.  One thing that I noticed is that it seems to take much longer for
  82. > the plots to be displayed running the tk driver than just the standard X
  83. > driver.  Do you notice that locally on dino?  Also, do you have a good demo
  84. > meta file lying around that I could grab and try?  I could not get plrender
  85. > to go backwards with my meta file using the tk driver and wonder if it is
  86. > because the meta file was generated by an ancient version of plplot.
  87. >         Dave
  88.  
  89. The current incarnation of the TK driver is going to run a bit slow
  90. over a network because of the way messages are passed between the
  91. user code and the renderer.  In this case plrender is the user code
  92. and it forks the actual renderer.
  93.  
  94. The TK send command does IPC by storing messages in an X property
  95. of the display.  This means that when running over a network, messages
  96. must travel from the X client to the X server and then back again.
  97. Kind of sick, I know.  So for the time being I recommend using the TK
  98. driver primarily locally.  
  99.  
  100. Eventually I will switch to a scheme where the renderer runs on the
  101. display server.  I don't think there will be many changes required for
  102. this to work.  The FIFO becomes a socket, and the TK send is replaced by
  103. Tcl-DP's send (which uses sockets).  I have to work out how to start the
  104. remote renderer.  Probably it could try doing a remsh (or rsh on systems
  105. that don't have remsh), and if it fails for security or other reasons,
  106. tell the user to start the renderer manually using some specified socket
  107. for communication.  I don't feel like getting into all this now but that's
  108. sort of how it will look.
  109.  
  110. --
  111. Maurice LeBrun    mjl@dino.ph.utexas.edu
  112. Institute for Fusion Studies, University of Texas at Austin
  113.  
  114. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  115. attendre, c'est pour mieux vous servir, et vous plaire.
  116.                                 [menu of restaurant Antoine, New Orleans]
  117.  
  118. From mjl@dino.ph.utexas.edu Tue Sep  7 23:55 CDT 1993
  119. Received: by dino.ph.utexas.edu
  120.     (1.37.109.4/16.2) id AA29917; Tue, 7 Sep 93 23:55:50 -0500
  121. Date: Tue, 7 Sep 93 23:55:50 -0500
  122. From: Maurice J. LeBrun <mjl@dino.ph.utexas.edu>
  123. Return-Path: <mjl@dino.ph.utexas.edu>
  124. To: furnish@dino.ph.utexas.edu, gray@dino.ph.utexas.edu,
  125.         mjl@dino.ph.utexas.edu, wdn@dino.ph.utexas.edu
  126. Subject: CVS update notice
  127. Status: RO
  128.  
  129. Update of /u/tpc/cvs/plplot/sys/unix
  130. In directory dino:/u/mjl/devel/plplot4p99d/sys/unix
  131.  
  132. Modified Files:
  133.     makefile.m4 
  134. Log Message:
  135. Now passes in INSTALL_DIR as a string containing the installation
  136. directory, typically /usr/local/plplot.  Files that get this information
  137. include plfont.c (for use in the font search path), plserver.c (for use in
  138. the autoload search path), and tk.c (to search for plserver befor the
  139. fork/exec).  The environmental ${PLPLOT_DIR} is ALWAYS placed before
  140. INSTALL_DIR in the search path in each case, so there is ready escape
  141. from the tyranny of a hardwired location.
  142.  
  143.  
  144. From mjl@dino.ph.utexas.edu Fri Jul 16 23:54 CDT 1993
  145. Received: by dino.ph.utexas.edu
  146.     (1.37.109.4/16.2) id AA06269; Fri, 16 Jul 93 23:54:30 -0500
  147. From: Maurice J. LeBrun <mjl@dino.ph.utexas.edu>
  148. Return-Path: <mjl@dino.ph.utexas.edu>
  149. Subject: plplot libraries
  150. To: furnish@dino.ph.utexas.edu, gray@dino.ph.utexas.edu,
  151.         wdn@dino.ph.utexas.edu
  152. Date: Fri, 16 Jul 93 23:54:30 CDT
  153. Cc: mjl@dino.ph.utexas.edu
  154. Mailer: Elm [revision: 70.85]
  155. Status: RO
  156.  
  157.  
  158. I finally got around to making a test that I was curious about.
  159. I compiled plplot's x01c under a variety of configurations to see the
  160. effect on executable size (on disk, stripped).  This is all under
  161. HP/UX.
  162.  
  163. Xlib (shared)   Xlib (archive)  TK (archive)    size
  164. -----------------------------------------------------
  165. no        no        no        233 KB
  166. yes        no        no        246 KB
  167. no        yes        no        406 KB
  168. yes        no        yes        754 KB
  169. no        yes        yes        918 KB <- getting up there,
  170.                      but still smaller than with Motif :-)
  171.  
  172. As can be seen, the penalty was almost zero when the shared X library was
  173. used, and probably the same would occur if the TK library were made
  174. shareable.  Although this doesn't mean there is no penalty for hooking up
  175. with these libraries, it does amount to a big savings in disk space
  176. (obviously), and I think even of run-time image if more than one app
  177. using these libraries is running (since only one copy needs to be in
  178. memory at a time).
  179.  
  180. Unfortunately it's still far from clear what libraries to retain in general.
  181. For workstations, I'd say *usually* go with the full Xlib & TK version,
  182. although it may be useful to provide libraries that have no X dependence.
  183. For Crays it becomes more difficult.  Partly because UNICOS has no shared
  184. libraries, and the libraries are bigger to boot.  But also it isn't clear
  185. that the TK driver will even run with acceptable speed, never mind whether
  186. running a GUI is appropriate use for a Cray (eventually the TK driver will
  187. become distributed and this point will become moot).  So on the Cray, it's
  188. tempting to provide libraries for use with the Xlib driver only, except that
  189. plrender be built with the TK driver as well.  Probably I won't decide this
  190. until I actually get TCL/TK up on the Crays and get to play with the TK
  191. driver out there.
  192.  
  193. If one were to allow for the possibility of building all three libraries
  194. it might look like the following:
  195.  
  196. libplplotf.a        no Xlib or TK
  197. libplplotfX.a        Xlib only
  198. libplplotftk.a        Xlib and TK
  199.  
  200. This would be nice from the user perspective if all sites followed this
  201. convention.  You would have no problems getting the right one from your
  202. makefile regardless of the system.  Or you could make a soft-link from
  203. whichever one of these you really want to ~/lib/libplplotf.a if you really
  204. want to simplify things.
  205.  
  206. But including the double precision versions you get 6 libraries.  Double it
  207. again for shared library versions.  Yes, that's 12 -- and getting ridiculous.
  208. Time to backtrack.
  209.  
  210. The system administrator is ultimately the arbiter of what goes on.  He 
  211. supposedly knows what libraries are the best match for his system and
  212. user base, and is also ultimately responsible when things go wrong.
  213.  
  214. So, I think the best compromise both gives some consistency to the user
  215. across multiple platforms while letting the sysadm tailor the choice of
  216. libraries.  As I envision it there will always exist at least two libraries
  217. -- libplplotf.a and libplplotd.a (actually one of these may be a softlink to
  218. the other, such as on Crays where float==double).  These are then linked to
  219. the libraries that are the best default for the system.
  220.  
  221. This is then:
  222.  
  223. (a) consistent -- the user can use libplplotf.a everywhere he goes with
  224. reasonable results.  The one minor pain here is that the linkage may be
  225. different from site to site, (-lX11 for the X driver, and -ltk -ltcl for the
  226. TK driver).  So probably a file called libplplotf.doc should exist with
  227. libplplotf.a that explains the linkage.
  228.  
  229. (b) flexible -- the system administrator can add as many custom libraries
  230. as desired.  The users can either link against them explicitly or put
  231. a soft-link from the desired library to ~/lib/libplplotf.a.  And you can
  232. change the system default (say, if you change your mind or many people
  233. request it) simply by changing a soft-link (and possibly building a new
  234. library version).
  235.  
  236. The makefile will make the system administrator's job easier by adopting the
  237. naming scheme mentioned above (something like libplplotfn.a for the library
  238. without Xlib or TK, if I bother to support it).  The exact name doesn't
  239. matter much since you'll be relying on softlinks to set the system defaults,
  240. but it's good to be consistent.
  241.  
  242. Probably for now I'll just add the two new libraries libplplotftk.a and
  243. libplplotdtk.a on workstations as I had previously planned.  The system
  244. default libplplotf.a could be made to point to these eventually (on dino,
  245. soonest, although I still have to check out the TK driver on Mark's
  246. X-terminal).  On the Cray, I'll leave the system default as-is until I can
  247. check out the TK driver on it.
  248.  
  249. Does this scheme sound reasonable to everyone?
  250. --
  251. Maurice LeBrun    mjl@dino.ph.utexas.edu
  252. Institute for Fusion Studies, University of Texas at Austin
  253.  
  254. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  255. attendre, c'est pour mieux vous servir, et vous plaire.
  256.                                 [menu of restaurant Antoine, New Orleans]
  257.  
  258.